import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/merchant/list',
    method: 'get',
    params: query
  })
}

export function merchantGetUser(data) {
  return request({
    url: `/merchant/getUser`,
    method: 'post',
    data
  })
}

export function checkPhone(phone) {
  return request({
    url: `/merchant/phone/${phone}`,
    method: 'get'
  })
}

export function addMerchant(query) {
  return request({
    url: '/merchant/create',
    method: 'post',
    data: query
  })
}

export function getMerchantDetail(id) {
  return request({
    url: `/merchant/${id}`,
    method: 'get'
  })
}

export function editMerchant(query) {
  return request({
    url: '/merchant/update',
    method: 'post',
    data: query
  })
}

export function delMerchant(id) {
  return request({
    url: `/merchant/${id}`,
    method: 'delete'
  })
}

export function addRecharge(query) {
  return request({
    url: '/merchantBackendRecharge/create',
    method: 'post',
    data: query
  })
}

export function listAuthPark(query) {
  return request({
    url: '/auth/listAuthPark',
    method: 'post',
    data: query
  })
}